package com.fxxw;


import javafx.application.Application;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

/**
 * 主程序入口
 */
public class MainApplication extends Application {

    /**
     * 程序初始化，这里可以初始化一些数据
     */
    @Override
    public void init() throws Exception {
        super.init();
    }

    /**
     * 开启窗口时，所有的 UI 程序写在这里
     * @param primaryStage the primary stage for this application, onto which
     * the application scene can be set. The primary stage will be embedded in
     * the browser if the application was launched as an applet.
     * Applications may create other stages, if needed, but they will not be
     * primary stages and will not be embedded in the browser.
     * @throws Exception
     */
    @Override
    public void start(Stage primaryStage) throws Exception {
        // 设置程序在菜单栏 和左上角 显示的图标，以及标题
        //"file:/img/logo.png"
        //primaryStage.getIcons().add(new Image("file:img/logo.png"));
        //primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("./resource/img/logo.png")));
        primaryStage.setTitle("汨罗一中点名器 -Made by 佛系小吴");

        // 设置窗体宽高
        primaryStage.setWidth(860);
        primaryStage.setHeight(480);

        // 设置窗口模式
        primaryStage.initStyle(StageStyle.DECORATED);

        // 显示窗口
        primaryStage.show();
    }

    /**
     * 程序关闭时，这里可以做关闭的确认等
     */
    @Override
    public void stop() throws Exception {
        super.stop();
    }

}
